home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 September / GSSH0904CD1.iso / RiseofNations / RedFront / RedFront.exe / Red Front / Red Front - 10 - Prokhorovka.bhs < prev    next >
Text File  |  2004-02-10  |  12KB  |  357 lines

  1. /* Red Front
  2.    Prokhorovka
  3.    
  4.    These events will control the Prokhorovka scenario for the Red Front campaign.
  5.   
  6.    Campaign By: Kevin 'DarthVeda' Chulski
  7.    Contact: darthveda@hotmail.com
  8.    Please email any questions/suggestions/comments that you have!   
  9. */
  10.  
  11. scenario
  12. {
  13.  
  14.   set_nation_name("Russians", $S("Red Army"));
  15.   set_nation_name("Romans", $S("Germans"));
  16.   
  17.   // initialize variables
  18.   
  19.   static int hours = 700;
  20.   static int rallyID = 0;
  21.   static int i = 0;
  22.   static int X = 0;
  23.   static int Y = 0;
  24.   
  25.   static int victory_condition = 0;
  26.   static int sovietTankReserve = 700;
  27.   static int germanTankReserve = 250;
  28.   static int numSovDead = 0;
  29.   static int numGerDead = 0;
  30.   
  31.   
  32. labels {
  33.   //Add any constant labels here in a comma separated list.
  34.   
  35. }
  36.  
  37. run_once {
  38.   //Insert commands that should be executed only once when the script is loaded here.
  39.   
  40.   //disable weird things
  41.   
  42.   disable_type("Helicopter");
  43.   disable_type("Nuclear Missile");
  44.   disable_type("Missile Silo");
  45.   disable_type("Aircraft Carrier");
  46.   disable_type("Spy");
  47.   
  48.   // disable wonders
  49.   
  50.   disable_type( "Pyramids" );
  51.   disable_type( "Colossus" );
  52.   disable_type( "Terra Cotta Army" );
  53.   disable_type( "Colosseum" );
  54.   disable_type( "Temple of Tikal" );
  55.   disable_type( "Porcelain Tower" );
  56.   disable_type( "Angkor Wat" );
  57.   disable_type( "Versailles" );
  58.   disable_type( "Statue of Liberty" );
  59.   disable_type( "Kremlin" );
  60.   disable_type( "Taj Mahal" );
  61.   disable_type( "Eiffel Tower" );
  62.   disable_type( "Supercollider" );
  63.   disable_type( "Space Program" );
  64.   
  65.   // disable certain buildings and guys
  66.   
  67.   disable_type( "Citizen" );
  68.   disable_type( "Caravan" );
  69.   disable_type( "Merchant" );
  70.   disable_type( "General" );
  71.   disable_type( "Fighter" );
  72.   disable_type( "Bomber" );
  73.   
  74.   // disable ships
  75.   
  76.   // Gain Upgrades 
  77.  
  78.   // disable upgrades 
  79.   
  80.   // set timers
  81.   
  82.   set_timer( "cdar", 3 );
  83.     
  84.   // disable triggers
  85.   
  86.   // blurb or cinematic
  87.   
  88.   // miscelaneous  
  89.   
  90.   set_object_type_max_health( "Small City", 100 );
  91.   set_object_type_max_health( "Large City", 250 );
  92.   set_object_type_max_health( "Major City", 500 );
  93.   buildings_gather_disable();
  94.   building_resource_bonus_disable();
  95.   plunder_disable();
  96.     
  97. }
  98.  
  99. //Main script body.
  100. //Add triggers and other commands to be executed each game frame here.
  101. //Use Edit->Insert Trigger Function to select from the list of available functions
  102. //Use Edit->Insert Trigger Block to add a blank trigger block.
  103. //See ./scenario/sample_script.bhs for additional documentation
  104.  
  105.   trigger opening_dialog ( )
  106.   {
  107.     add_objective_text( "Time: 0700 Hours", "date", "null.wav" );
  108.     popup_dialog( "July 1943 - Russian and German offensives and counter-offensives throughout the Spring have left a distinctive bulge around the Soviet city of Kursk.  The Germans have launched operation 'Citadel' aimed at entraping the Russian armies inside this bulge.  In the South, the Germans stand poised at a breakthrough, however, the Russians are set to counter-attack with the 5th Guards Army, which has been rushed to the scene soon after the offensive began." );
  109.     popup_dialog( "One of the most massive armored battles of the war is at hand as the 5th Guards Tank Army collides with 3 SS Units and 5 Panzer Divisions in the fields outside a city named Prokhorovka." );
  110.     popup_dialog( "General, because of the length of time we have had to prepare for this German offensive, you will have your choice of victory conditions.  Remember that this decisive battle must be decided by the end of the day (2000 hours)." );
  111.     
  112.     while ( victory_condition == 0 )
  113.     {
  114.       if ( popup_choice( "OPTION A: Reduce the German tank reserve on this front to zero", "Wipe them out", "What else..." ) == 1 )
  115.       {
  116.         victory_condition = 1;
  117.       }
  118.       else if ( popup_choice( "OPTION B: Prevent the Germans from taking any ground", "And stay out", "Put that on hold..." ) == 1 )
  119.       {
  120.         victory_condition = 2;
  121.       }
  122.       else if ( popup_choice( "OPTION C: Capture a German Headquarters", "The HQ is kaput", "Go back..." ) == 1 )
  123.       {
  124.         victory_condition = 3;
  125.       }
  126.     }
  127.     
  128.     if ( victory_condition == 1 )
  129.     {
  130.       disable_trigger( "tallyho" );
  131.       add_objective( "Reduce German tank reserve to zero", "reduce", "null.wav" );
  132.       add_objective_text( "German Tank Reserve: " +germanTankReserve, "gtr", "null.wav" );
  133.       add_objective_text( "Soviet Tank Reserve: " +sovietTankReserve, "str", "null.wav" );
  134.       popup_dialog( "You have chosen to reduce the number of German tanks to zero.  German tank reserves must equal zero by the end of the day.  You must not exhaust your own reserve though." );
  135.     }
  136.     else if ( victory_condition == 2 )
  137.     {
  138.       add_objective( "No retreat", "noretreat", "null.wav" );
  139.       popup_dialog( "You have chosen to not let the Germans take a single city.  Your defensive mettle will be tested today, comrade general." );
  140.     }
  141.     else
  142.     {
  143.       disable_trigger( "tallyho" );
  144.       add_objective( "Capture a German headquarters", "caphq", "null.wav" );
  145.       popup_dialog( "Your goal today is to capture a German headquarters.  General, if you can eliminate one of the pincer groups pressing on Prokhorovka, you will achieve victory." );
  146.     }
  147.     
  148.     if ( victory_condition != 3 )
  149.     {
  150.       create_building( 3, 8, 158, "Redoubt" );
  151.       create_building( 3, 40, 169, "Redoubt" );
  152.       create_building( 2, 105, 183, "Redoubt" );
  153.       create_building( 2, 120, 181, "Redoubt" );
  154.       if ( victory_condition == 2 )
  155.       {
  156.         for( i = 2; i < 4; i++ )
  157.         {
  158.           gain_tech( i, "Allegiance" );
  159.           gain_tech( i, "Oath of Fealty" );
  160.           gain_tech( i, "Patriotism" );
  161.           gain_tech( i, "Nationalism" );
  162.         }
  163.       }
  164.     }
  165.     
  166.   }
  167.   
  168.   trigger vic1_updater ( ( !germanTankReserve || !sovietTankReserve ) && victory_condition == 1 )
  169.   {
  170.     if ( !germanTankReserve )
  171.     {
  172.       // victory
  173.       objective_complete( "reduce" );
  174.       objective_complete( "gtr" );
  175.       objective_complete( "str" );
  176.       popup_dialog( "The complete anihilation of hundreds of German tanks comes as a severe blow to the German armies in the Soviet Union.  It is a stun from which they will not soon recover.  Already the German offensive has halted and German units involved in the attack are in full retreat as Soviet soldiers drive on to victory." );
  177.       popup_dialog( "You are now ready for the eleventh part of this campaign.  Please load the next scenario in the Red Front sequence." );
  178.       victory( 1 );
  179.     }
  180.     else if ( !sovietTankReserve )
  181.     {
  182.       // defeat
  183.       popup_dialog( "The Germans have completely overrun the Russian armies at Kursk.  The destruction of an entire tank army and the entrapment of two entire Soviet army groups was so swift that memories of 1941 are rife in the German and Soviet HQ.  The German army seems unstoppable as the war seems to continue without end.  However, your services will no longer be required." );
  184.       defeat( 1 );
  185.     }
  186.   
  187.   }
  188.   
  189.   trigger sovUp ( ( num_units_killed( 2 ) + num_units_killed( 3 ) ) > numSovDead )
  190.   {
  191.     numSovDead = ( num_units_killed( 2 ) + num_units_killed( 3 ) );
  192.     sovietTankReserve--;
  193.     if ( victory_condition == 1)
  194.     {
  195.       sovietTankReserve--;
  196.       change_objective_text( "str", "Soviet Tank Reserve: " +sovietTankReserve );
  197.     }
  198.     else if ( sovietTankReserve < 10 )
  199.     {
  200.       germanTankReserve = 99;
  201.     }
  202.     
  203.     if ( sovietTankReserve % 3 == 0 )
  204.     {
  205.       // Create light tank
  206.       create_unit( 1, 61, 1, "T70 Tank", 1 );
  207.       group_attack_to_order( 1, 78, 25 );
  208.     }
  209.     else
  210.     {
  211.       // create normal tank
  212.       create_unit( 1, 61, 1, "Tank", 1 );
  213.       group_attack_to_order( 1, 78, 25 );
  214.     }
  215.     
  216.     enable_trigger( "sovUp" );
  217.   }
  218.   
  219.   trigger gerUp ( num_units_killed( 1 ) > numGerDead )
  220.   {
  221.     numGerDead = num_units_killed( 1 );
  222.     germanTankReserve--;
  223.     if ( victory_condition == 1)
  224.     {
  225.       change_objective_text( "gtr", "German Tank Reserve: " + germanTankReserve );
  226.     }
  227.     else if ( germanTankReserve < 10 )
  228.     {
  229.       germanTankReserve = 99;
  230.     }
  231.     
  232.     if ( germanTankReserve % 3 == 0 )
  233.     {
  234.       create_unit( 3, 21, 186, "Tiger Tank", 1 );
  235.     }
  236.     else
  237.     {
  238.       create_unit( 2, 137, 190, "Tank", 1 );
  239.     }
  240.     
  241.     enable_trigger( "gerUp" );
  242.   }
  243.   
  244.   trigger reinforce_remind ( ( object_type_near( 1, "T70 Tank", 5, 78, 25, 10 ) ) && ( time_sec() < 300 ) )
  245.   {
  246.     ping( 1, 1, 78, 25 );
  247.     print_msg( "Remember General, that as our tanks our depleted, more will become available at Prokhorovka." );
  248.   }
  249.   
  250.   trigger vic2_fail ( ( num_cities( 1 ) < 7 ) && ( victory_condition == 2 ) )
  251.   {
  252.     remove_objective( "noretreat" );
  253.     popup_dialog( "You have failed to keep your promises to high command.  For your failure you have been dismissed" );
  254.     defeat( 1 );
  255.   }
  256.   
  257.   trigger vic3_win ( ( is_defeated( 2 ) || is_defeated( 3 ) ) && victory_condition == 3 )
  258.   {
  259.     objective_complete( "caphq" );
  260.     popup_dialog( "The Germans, thrown back at Prokhorovka, have begun withdrawing from the Kursk offensive.  Stavka is already planning a counter-offensive aimed at evening up the front and pushing out the sides of the Kursk bulge." );
  261.     popup_dialog( "You are now ready for the eleventh part of this campaign.  Please load the next scenario in the Red Front sequence." );
  262.     victory( 1 );
  263.   }
  264.   
  265.   trigger calendar ( timer_expired( "cdar" ) )
  266.   {  
  267.     if ( hours%100 == 59 )
  268.     {
  269.       hours+= 40;
  270.     }
  271.     else
  272.     {
  273.       hours++;
  274.     }
  275.     if ( hours == 2000 )
  276.     {
  277.       // end of the scenario...
  278.       if ( ( victory_condition == 1 ) || ( victory_condition == 3 ) )
  279.       {
  280.         popup_dialog( "Unable to complete your objectives by the end of the day, you have been dismissed." );
  281.         defeat( 1 );
  282.       }
  283.       else if ( victory_condition == 2 )
  284.       {
  285.         // victory
  286.         popup_dialog( "The Germans, their attacks blunted at every turn by your superb leadership, have settled themselves into a standoff situation.  They attempt another attack near Oboyan on the 13th, which is also blunted.  Facing a stalemate, the Germans have chosen to retreat to more defendable positions.  Hot on their trail is the Red Army.  Your work here has been oustanding, comrade general!" );
  287.         popup_dialog( "You are now ready for the eleventh part of this campaign.  Please load the next scenario in the Red Front sequence." );
  288.         victory( 1 );
  289.       }
  290.     }
  291.     
  292.     if ( hours < 1000 )
  293.     {
  294.       change_objective_text( "date", "Time: 0" + hours + " Hours" );
  295.     }
  296.     else
  297.     {
  298.       change_objective_text( "date", "Time: " + hours + " Hours" );
  299.     }
  300.     
  301.     // also update the daily production
  302.        
  303.     set_timer( "cdar", 3 );
  304.     enable_trigger( "calendar" );
  305.   } // end of calendar trigger
  306.   
  307.   trigger tallyho ( ( time_sec()%60 == 0 ) && ( victory_condition == 2 ) )
  308.   {
  309.     rallyID = 0;
  310.     
  311.     for( i = 0; i < population( 2 ); i++ )
  312.     {
  313.       rallyID = find_military( 2 );
  314.       unit_attack_to_order( 2, rallyID, 78, 25 );
  315.     }
  316.     for( i = 0; i < population( 3 ); i++ )
  317.     {
  318.       rallyID = find_military( 3 );
  319.       unit_attack_to_order( 3, rallyID, 78, 25 );
  320.     }
  321.     
  322.     enable_trigger( "tallyho" );
  323.   }
  324.   
  325.   trigger invincible_sol ( )
  326.   {
  327.     rallyID = 0;
  328.     
  329.     for( i = 0; i <= num_type( 3, "Statue of Liberty" ); i++ ) 
  330.     {
  331.       rallyID = find_build( 3, "Statue of Liberty" );
  332.       heal_object( 3, rallyID, 100);
  333.     }
  334.     for( i = 0; i <= num_type( 2, "Statue of Liberty" ); i++ ) 
  335.     {
  336.       rallyID = find_build( 2, "Statue of Liberty" );
  337.       heal_object( 2, rallyID, 100);
  338.     }
  339.            
  340.     enable_trigger( "invincible_sol" );
  341.   }
  342.   
  343.   trigger equalizer( )
  344.   {
  345.     rallyID = 0;
  346.   
  347.     while( num_units( 2 ) < num_units( 3 ) )
  348.     {
  349.       rallyID = find_military( 3 );
  350.       kill_unit_anim( 3, rallyID, 1 );
  351.       create_unit( 2, 137, 190, "Tank", 1 );
  352.     }
  353.   
  354.     enable_trigger( "equalizer" );
  355.   }
  356.     
  357. }